#if !defined(__MEMCHUNK_H__)
#define __MEMCHUNK_H__

typedef struct
{
    char *ptr;
    int size;
} MemChunk;

/**
 * @brief Memchunk初始化方法。初始化之前必须清零，重复调用会释放掉之前的内存。
 * 
 * @param chunk 
 * @return int 0成功 -1失败
 */
int memchunk_init(MemChunk *chunk);

int memchunk_append(MemChunk *chunk, void *data, int size);

void memchunk_free(MemChunk *chunk);

#endif // __MEMCHUNK_H__